home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / getprotoent.man < prev    next >
Encoding:
Text File  |  1990-04-13  |  2.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GETPROTOENT           C Library Procedures            GETPROTOENT
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      getprotoent, getprotobynumber, getprotobyname, setprotoent,
  10.      endprotoent - get protocol entry
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ##iinncclluuddee <<nneettddbb..hh>>
  14.  
  15.      ssttrruucctt pprroottooeenntt **ggeettpprroottooeenntt(())
  16.  
  17.      ssttrruucctt pprroottooeenntt **ggeettpprroottoobbyynnaammee((nnaammee))
  18.      cchhaarr **nnaammee;;
  19.  
  20.      ssttrruucctt pprroottooeenntt **ggeettpprroottoobbyynnuummbbeerr((pprroottoo))
  21.      iinntt pprroottoo;;
  22.  
  23.      sseettpprroottooeenntt((ssttaayyooppeenn))
  24.      iinntt ssttaayyooppeenn
  25.  
  26.      eennddpprroottooeenntt(())
  27.  
  28. DDEESSCCRRIIPPTTIIOONN
  29.      _G_e_t_p_r_o_t_o_e_n_t, _g_e_t_p_r_o_t_o_b_y_n_a_m_e, and _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r each
  30.      return a pointer to an object with the following structure
  31.      containing the broken-out fields of a line in the network
  32.      protocol data base, /_e_t_c/_p_r_o_t_o_c_o_l_s.
  33.  
  34.           struct    protoent {
  35.                char *p_name;  /* official name of protocol */
  36.                char **p_aliases;   /* alias list */
  37.                int  p_proto;  /* protocol number */
  38.           };
  39.  
  40.      The members of this structure are:
  41.  
  42.      p_name     The official name of the protocol.
  43.  
  44.      p_aliases  A zero terminated list of alternate names for the
  45.                 protocol.
  46.  
  47.      p_proto    The protocol number.
  48.  
  49.      _G_e_t_p_r_o_t_o_e_n_t reads the next line of  the  file,  opening  the
  50.      file if necessary.
  51.  
  52.      _S_e_t_p_r_o_t_o_e_n_t opens and rewinds the  file.   If  the  _s_t_a_y_o_p_e_n
  53.      flag is non-zero, the net data base will not be closed after
  54.      each call to _g_e_t_p_r_o_t_o_b_y_n_a_m_e or _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r.
  55.  
  56.      _E_n_d_p_r_o_t_o_e_n_t closes the file.
  57.  
  58.      _G_e_t_p_r_o_t_o_b_y_n_a_m_e and _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r sequentially search from
  59.      the  beginning of the file until a matching protocol name or
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 19, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETPROTOENT           C Library Procedures            GETPROTOENT
  71.  
  72.  
  73.  
  74.      protocol number is found, or until EOF is encountered.
  75.  
  76. FFIILLEESS
  77.      /etc/protocols
  78.  
  79. SSEEEE AALLSSOO
  80.      protocols(5)
  81.  
  82. DDIIAAGGNNOOSSTTIICCSS
  83.      Null pointer (0) returned on EOF or error.
  84.  
  85. BBUUGGSS
  86.      All information is contained in a static area so it must  be
  87.      copied  if  it  is to be saved.  Only the Internet protocols
  88.      are currently understood.
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 19, 1986                          2
  130.  
  131.  
  132.  
  133.